using System;
namespace ch.ethz.ssh2.packets
{
	
	
	/// <summary> PacketSessionSubsystemRequest.
	/// 
	/// </summary>
	/// <author>  Christian Plattner
	/// </author>
	/// <version>  2.50, 03/15/10
	/// </version>
	public class PacketSessionSubsystemRequest
	{
		virtual public byte[] Payload
		{
			get
			{
				if (payload == null)
				{
					TypesWriter tw = new TypesWriter();
					tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
					tw.writeUINT32(recipientChannelID);
					tw.writeString("subsystem");
					tw.writeBoolean(wantReply);
					tw.writeString(subsystem);
					payload = tw.getBytes();
					tw.getBytes(payload);
				}
				return payload;
			}
			
		}
		internal byte[] payload;
		
		public int recipientChannelID;
		public bool wantReply;
		public System.String subsystem;
		
		public PacketSessionSubsystemRequest(int recipientChannelID, bool wantReply, System.String subsystem)
		{
			this.recipientChannelID = recipientChannelID;
			this.wantReply = wantReply;
			this.subsystem = subsystem;
		}
	}
}